package com.example.springboot.RabbitMQ;

import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Slf4j
@Component
public class TestConsumer_02 {

    private static final String exchangeName = "exchange_Direct_01";
    private static final String queueName_01 = "queue_Direct_01";
    private static final String routingKey_01 = "routingKey_Direct_01";

//        @RabbitListener(
//            bindings = @QueueBinding(
//                    value = @Queue(value = queueName_01, durable = "ture"),
//                    exchange = @Exchange(value = exchangeName),
//                    key = {routingKey_01}
//            )
//    )
    public void receive_03(String dataString, Message message, Channel channel) throws IOException, InterruptedException {

        log.info("消费者接收到的消息是：" + dataString);

    }

}